package project

import (
	"github.com/gogf/gf/v2/frame/g"
	"github.com/gogf/gf/v2/os/gtime"
	"server-asset/internal/model/entity"
)

/*
 * 定义请求
 */
type ProjectListReq struct {
	g.Meta    `path:"/project" method:"post" tags:"Deployment" summary:"获取项目列表"`
	Page      int         `p:"page"      v:"min:1#页码最小为1"  dc:"页码"`
	Size      int         `p:"size"      v:"max:100#每页最多100条" dc:"每页数量"`
	Id        int         `json:"id"  dc:"服务器ID"`
	Name      string      `json:"name"   dc:"应用名称"`
	City      string      `json:"city" dc:"开始时间"`
	SalesInfo string      `json:"sales_info"   dc:"结束时间"`
	createdAt *gtime.Time `json:"created_at"   dc:"创建时间"`
}

/*
 * 响应数据结构
 */
type ProjectListRes struct {
	List  []*entity.Project `json:"list"`
	Total int               `json:"total"`
	Page  int               `json:"page"`
	Size  int               `json:"size"`
}

type ProjectAddReq struct {
	Name      string `v:"required|length:2,50#项目名称必填|名称长度2-50位"`
	City      string `v:"required#所属城市必填"`
	SalesInfo string `v:"max-length:500#销售信息不超过500字"`
}

type ProjectAddRes struct {
	Name      string `json:name`
	City      string `json:city`
	SalesInfo string `josn:"sales_info"`
}

type ProjectUpdateReq struct {
	Id        int    `v:"required#项目ID必填"`
	Name      string `v:"required|length:2,50"`
	City      string `v:"required"`
	SalesInfo string
}

type ProjectUpdateRes struct {
	Id        int    `json:id`
	Name      string `json:name`
	City      string `json:city`
	SalesInfo string `json:sales_info`
}
